<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\web\NotFoundHttpException;

//chỉ user mới có quyền
if(Yii::$app->user->isGuest || Yii::$app->user->identity->acc_id!=$acc_id)
{
	throw new NotFoundHttpException('The requested page does not exist.');
}
else
{

	/* @var $this yii\web\View */
	/* @var $searchModel app\models\PaymentSearch */
	/* @var $dataProvider yii\data\ActiveDataProvider */

	$this->title = 'Thanh toán bạn đã nhận';
	//$this->params['breadcrumbs'][] = $this->title;
	?>
	<div class="payment-index">

		<h1><?= Html::encode($this->title) ?></h1>
		<?php // echo $this->render('_search', ['model' => $searchModel]); ?>


		<p>
			<?= Html::a('Yêu cầu thanh toán mới', ['create'], ['class' => 'btn btn-success']) ?>
		</p>
		<?= GridView::widget([
			'dataProvider' => $dataProvider,
			'filterModel' => $searchModel,
			'columns' => [
				['class' => 'yii\grid\SerialColumn'],

				//'payment_id',
				//'acc_pay_add_id',
				'accPayAdd.payType.type_name',
				'accPayAdd.pay_address',
				'amount',
				'description:ntext',
				
				['class' => 'yii\grid\CheckboxColumn',
					'header' => 'Đã thanh toán',
					'checkboxOptions' => function($model, $key, $index, $column) {
						return ['disabled' => true, 
								'checked' => $model->status==0?false:true];
}
				],

			],
		]); ?>

	</div>

<?php
}
?>